import unittest

from htmltestreport import HTMLTestReport

import config
from common.log_config import info_loggin
from scripts.test01_RegLogin import TestRegLogin
from scripts.test02_Account import TestOpenAccount
from scripts.test03_recharge import TestRecharge
from scripts.test04_Tender import TestTender

# 实例化测试套件
suite = unittest.TestSuite()
# 添加测试类
suite.addTest(unittest.makeSuite(TestRegLogin))
suite.addTest(unittest.makeSuite(TestOpenAccount))
suite.addTest(unittest.makeSuite(TestRecharge))
suite.addTest(unittest.makeSuite(TestTender))

# 定义测试报告存放的目录
report_path = config.BASE_DIR + "/report/report.html"

if __name__ == '__main__':
    suite = unittest.defaultTestLoader.discover(config.BASE_DIR + '/scripts', 'test*')
    report = HTMLTestReport(config.BASE_DIR + '/report./report.html', title="测试报告", description="V1.0")
    report.run(suite)



# # 实例化TextTestRunner类
# runner = unittest.TextTestRunner()
# # 运行测试套件
# runner.run(suite)


